package jp.sourceforge.akjrcp.text_douga;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class DougaSystem {
	public static Log log = LogFactory.getLog(DougaSystem.class);
private VideoSystem videoSytem;
private AudioSystem audioSystem;
public static final int FOREEVER = -1;

public static DougaLogger dougaLogger=new DefaultDougaLogger();
public static boolean cancelling;//TODO 
public DougaSystem(){
	videoSytem=new VideoSystem();
	audioSystem=new AudioSystem();
	cancelling=false;
}

public void setFfmpegPath(String path){
	audioSystem.getDougaPreference().setFfmpegPath(path);
	videoSytem.getDougaPreference().setFfmpegPath(path);
}

public AudioSystem getAudioSystem() {
	return audioSystem;
}
public void setAudioSystem(AudioSystem audioSystem) {
	this.audioSystem = audioSystem;
}
public VideoSystem getVideoSystem() {
	return videoSytem;
}
public void setVideoSytem(VideoSystem videoSytem) {
	this.videoSytem = videoSytem;
}

public static DougaLogger getDougaLogger() {
	return dougaLogger;
}

public static void setDougaLogger(DougaLogger dougaLogger) {
	DougaSystem.dougaLogger = dougaLogger;
}

public static class DefaultDougaLogger implements DougaLogger{

	public void error(String log) {
		System.out.println("error:"+log);
	}

	public void info(String log) {
		System.out.println("info:"+log);
	}

	public void trace(String log) {
		System.out.println("trace:"+log);
	}

	public void warn(String log) {
		System.out.println("warn:"+log);
	}
	
}
}
